#!/bin/sh
clear
if [ -n "$1" ]; then
	cd $1
else
	echo "No parameter found!Build failed."
	exit
fi
echo "Building...Please wait."
if [ -n "$2" ]; then
	g++ $2
else
	g++ main.cpp
fi
clear
if [ -f "./a.out" ]; then
	echo "Running..."
	./a.out
else
	echo "Program not found!Compile error."
	exit
fi
